<template>
	<view class="home-scroll-view">
		<view class="title">
			<h2>
				{{title}}
			</h2>
			<span @click="handelClick">{{handelName}}
				<slot name="icon"></slot>
			</span>

		</view>
		<view class="scroll-view-body">
			<slot></slot>
		</view>
	</view>
</template>

<script>
	export default {
		name: "homeScrollView",
		props: {
			title: {
				default: '',
				type: String
			},
			handelName: {
				default: '',
				type: String
			},
		},
		data() {
			return {};
		},
		methods: {
			// 右上角点击事件
			handelClick() {
				this.$emit('handleClick')
			}
		},
	}
</script>

<style lang="scss" scoped>
	.home-scroll-view {
		.title {
			line-height: 48rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;

			h2 {
				font-size: 40rpx;
				font-weight: 400;
			}

			>span {
				font-size: 26rpx;
			}
		}

		.scroll-view-body {
			margin-top: 40rpx;

			scroll-view {
				// flex-wrap: nowrap;
				white-space: nowrap;
			}
		}
	}
</style>
